package com.ivo.service.hr;

import java.util.List;

import org.springframework.stereotype.Service;

import com.ivo.model.hr.Department;
import com.ivo.service.BaseService;

@Service
public class DepartmentService extends BaseService<Department>
{
	public List<Department> getChildDepts(String parent_FK)
	{
		String hql = "from Department a where a.parent_FK = '" + parent_FK + "' and a.validFlag = 1";
		List<Department> list = getInstanceSet( hql );
		return list;
	}

	public List<Department> getFindChildDeptFlat(String id)
	{
		String sql = " EXEC HR_SP_FindChildDeptFlat ? ";
		List list = hibernateCaller.sqlQuery( sql, Department.class, id );
		return list;
	}

}
